package cn.com.code.hwjs;

import java.util.Scanner;

/**
 * 统计每个月兔子的总数
 * https://www.nowcoder.com/practice/1221ec77125d4370833fd3ad5ba72395?tpId=37&tqId=21260&rp=1&ru=/exam/oj/ta&qru=/exam/oj/ta&sourceUrl=%2Fexam%2Foj%2Fta%3FtpId%3D37&difficulty=undefined&judgeStatus=undefined&tags=&title=
 *
 * @author zhengpei
 * @date 2022/6/9
 */
public class Hwjs37 {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    while (sc.hasNext()) {
      int num = sc.nextInt();
      System.out.println(result(num));
    }
  }

  private static int result(int num) {
    if (num < 3) {
      return 1;
    }
    //result(num-1)表示上个月的兔子,result(num-2)表示上个月能生的兔子

    return result(num - 1) + result(num - 2);
  }

}
